Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

506
Vistas
Discord.JS DiscordAPIError[50035] Invalid Form Body when registering my commands

I am writing a suggest command using a basic command handler from the discord.js guide, whenever I deploy my commands I get the below error. I have tried to edit my embeds to see if that was my issue since I'm fairly new to DiscordJS.


    DiscordAPIError[50035]: Invalid Form Body
guild_id[NUMBER_TYPE_COERCE]: Value "undefined" is not snowflake.
    at SequentialHandler.runRequest (/home/container/node_modules/@discordjs/rest/dist/index.js:753:15)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async SequentialHandler.queueRequest (/home/container/node_modules/@discordjs/rest/dist/index.js:565:14)
    at async REST.request (/home/container/node_modules/@discordjs/rest/dist/index.js:999:22) {
  rawError: {
    code: 50035,
    errors: { guild_id: [Object] },
    message: 'Invalid Form Body'
  },
  code: 50035,
  status: 400,
  method: 'PUT',
  url: 'https://discord.com/api/v9/applications/991898175478714409/guilds/undefined/commands',
  requestBody: { files: undefined, json: [ [Object], [Object], [Object] ] }
}

Below is my suggestion command code:


    const { SlashCommandBuilder } = require('@discordjs/builders');
const { MessageEmbed, MessageActionRow, MessageButton } = require('discord.js');
const { suggestChannelID, suggestLogChannelID, suggestManageRoleID } = require('/home/container/config.json');

module.exports = {
  data : new SlashCommandBuilder()
    .setName('suggest')
    .addStringOption(option => option.setName('suggestion').setDescription('The feature you want to suggest').setRequired(true))
    .setDescription('Suggest a feature to be added to our platform(s)'),
  async execute(interaction) {
    var d = new Date();
    const suggestEmbed = new MessageEmbed()
      .setTitle('New Suggestion')
      .setDescription(interaction.options.getString('Suggestion'))
      .setFooter({ text: `Suggested by <@${interaction.member.id}> @ ` + d.toLocaleTimeString() + " GMT" })
    const row = new MessageActionRow()
      .addComponents(
        new MessageButton()
          .setCustomId('upvote')
          .setStyle('SUCCESS')
          .setLabel('Upvote'),
        new MessageButton()
          .setCustomId('downvote')
          .setStyle('DANGER')
          .setLabel('downvote'),
        new MessageButton()
          .setCustomId('accept')
          .setStyle('SUCCESS')
          .setLabel('Accept'),
        new MessageButton()
          .setCustomId('deny')
          .setStyle('DANGER')
          .setLabel('Deny'),
        new MessageButton()
          .setCustomId('remove')
          .setStyle('SECONDARY')
          .setLabel('Remove'),
      )
    interaction.member.guild.channels.cache.get(suggestChannelID).send({ embeds: [suggestEmbed], components: [row] });
    interaction.reply('Suggestion successfully sent!')
  }
}


about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda